/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package alcatelparser.tags;

import alcatelparser.modules.AlgoUtil;
import alcatelparser.modules.BuilderFactory;
import alcatelparser.modules.I;

/**
 *
 * @author geniuz
 */
public class PartialGenerationTag extends DefaultParserTag
{

    public PartialGenerationTag()
    {
    }

    public final void parseTag(int ai[], int i)
    {
        setStandartLength(ai, i);/*
        _array = ai;
        _startParsePosition = i;
        if(isFullForm())
            BuilderFactory.getBuilder().writeTagContent(3, 0, getTagPropertiesValue(I.I(6572)), getTagIdentifyContent(i, i + 1));
        int j = AlgoUtil.getLength(ai, i + 1);
        int k = 0;
        while(j > 0) 
        {
            _subTagCurPosition = i + k + 2;
            int l = ai[_subTagCurPosition];
            if(l == 128)
            {
                parsePartialRecordNumber();
                j -= 4;
                k += 4;
            } else
            if(l == 129)
            {
                parsePartialRecorReason();
                j -= 3;
                k += 3;
            } else
            {
                j--;
            }
        }*/
    }

    private void parsePartialRecordNumber()
    {
        if(isFullForm())
        {
            String s = (new StringBuilder()).append(getTagIdentifyContent(_subTagCurPosition, _subTagCurPosition + 1)).append(toHex(_array[_subTagCurPosition + 3])).toString();
            BuilderFactory.getBuilder().writeTagContent(4, 0, getTagPropertiesValue(I.I(2026)), s);
        } else
        if(isTagChecked(I.I(2006)))
        {
            String s1 = (new StringBuilder()).append(toHex(_array[_subTagCurPosition + 3])).append(toHex(_array[_subTagCurPosition + 3])).toString();
            String s2 = isFieldsDecoding() ? toHex(_array[_subTagCurPosition + 3]) : s1;
            BuilderFactory.getBuilder().writeTagContent(1, 0, getReducedTagPropertiesValue(I.I(2026)), s2);
        }
    }

    private void parsePartialRecorReason()
    {
        if(isFullForm())
        {
            String s = (new StringBuilder()).append(getTagIdentifyContent(_subTagCurPosition, _subTagCurPosition + 1)).append(toHex(_array[_subTagCurPosition + 2])).append(I.I(5425)).append(getTagPropertiesValue((new StringBuilder()).append(I.I(6560)).append(_array[_subTagCurPosition + 2]).toString())).toString();
            BuilderFactory.getBuilder().writeTagContent(4, 0, "", s);
        } else
        if(isTagChecked(I.I(2052)))
        {
            String s1 = isFieldsDecoding() ? getTagPropertiesValue((new StringBuilder()).append(I.I(6560)).append(_array[_subTagCurPosition + 2]).toString()) : toHex(_array[_subTagCurPosition + 2]);
            BuilderFactory.getBuilder().writeTagContent(1, 0, getReducedTagPropertiesValue(I.I(2072)), s1);
        }
    }

    public final String getParseIdentityTag()
    {
        return I.I(6557);
    }

    private int _subTagCurPosition;
}
